package cn.itcast.service.impl;

import cn.itcast.dataobject.Member;
import cn.itcast.repository.MemberRepository;
import cn.itcast.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: wangxg
 * @date: 2019-06-22 05:20
 **/

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberRepository memberRepository;

    @Override
    public List<Member> list() {
        return memberRepository.findAll();
    }

    @Override
    public void removeById(Long memberId) {
        memberRepository.deleteById(memberId);
    }

    @Override
    public void save(Member member) {
        memberRepository.save(member);
    }
}
